package cn.echase.ecare.yinfayun.controller.statistics;

import cn.echase.common.result.aop.EchaseResponseResult;
import cn.echase.ecare.yinfayun.domain.dto.OrgBedStatisticsDto;
import cn.echase.ecare.yinfayun.domain.vo.OrgBedDetailVo;
import cn.echase.ecare.yinfayun.domain.vo.OrgBedStatisticsVo;
import cn.echase.ecare.yinfayun.service.IOrgBedStatisticsService;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 机构床位统计
 */
@Slf4j
@RestController
@RequestMapping("/bed/statistic")
@EchaseResponseResult
@RequiredArgsConstructor
public class OrgBedStatisticsController {

    private final IOrgBedStatisticsService orgBedStatisticsService;

    @PostMapping("/summary")
    @Log(title = "查询", businessType = BusinessType.OTHER)
    public OrgBedStatisticsVo summary(@RequestBody OrgBedStatisticsDto orgBedStatisticsDto) {
        return orgBedStatisticsService.getOrgBedSummary(orgBedStatisticsDto);
    }

    @PostMapping("/detail")
    @Log(title = "查询", businessType = BusinessType.OTHER)
    public TableDataInfo<OrgBedDetailVo> detail(@RequestBody OrgBedStatisticsDto orgBedStatisticsDto) {
        return orgBedStatisticsService.getBedInfoList(orgBedStatisticsDto);
    }

}
